import React from 'react';
import Modal from '../../Modal';

interface ConsolidateKeyInfoModalProps {
    isOpen: boolean;
    onClose: () => void;
    consolidationSummary: string;
    setConsolidationSummary: (summary: string) => void;
    confirmAndApplyConsolidation: () => void;
}

const ConsolidateKeyInfoModal: React.FC<ConsolidateKeyInfoModalProps> = ({
    isOpen,
    onClose,
    consolidationSummary,
    setConsolidationSummary,
    confirmAndApplyConsolidation
}) => {
    return (
        <Modal
            isOpen={isOpen}
            onClose={onClose}
            title="整合关键信息摘要"
            footer={
                <div className="flex justify-end space-x-3">
                    <button onClick={onClose} className="px-4 py-2 bg-gray-600 hover:bg-gray-700 rounded text-white">取消</button>
                    <button onClick={confirmAndApplyConsolidation} className="px-4 py-2 bg-blue-600 hover:bg-blue-700 rounded text-white">确认整合</button>
                </div>
            }
        >
            <div className="space-y-4">
                <p className="text-sm text-yellow-400">
                    此操作会将以下摘要内容设置为当前回合的关键信息，并清空所有先前回合的信息。您可以编辑下面的摘要。此操作在确认后不可逆。
                </p>
                <textarea
                    value={consolidationSummary}
                    onChange={(e) => setConsolidationSummary(e.target.value)}
                    className="w-full h-64 bg-gray-900 text-gray-200 font-mono text-sm p-2 rounded border border-gray-600 focus:ring-2 focus:ring-blue-500 outline-none"
                />
            </div>
        </Modal>
    );
};

export default ConsolidateKeyInfoModal;
